/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.kmcsoft.goldshop.model.master;

import javax.jdo.annotations.Column;
import javax.jdo.annotations.FetchGroup;
import javax.jdo.annotations.FetchGroups;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;

/**
 *
 * @author kmcsoft02
 */
@PersistenceCapable(detachable = "true", table = "SHOP_product")
@FetchGroups(value = {
    @FetchGroup(name = "detach_ProductJewelry_All", members = {
        @Persistent(name = "jewelryCost"),
        @Persistent(name = "style"),
        @Persistent(name = "currency"),
        @Persistent(name = "productGold"),
        @Persistent(name = "goldsmith"),
        @Persistent(name = "unit"),
        @Persistent(name = "person"),
        @Persistent(name = "statusHistoryProducts"),
        @Persistent(name = "importJewelryDetail")}),
    @FetchGroup(name = "detach_ProductJewelry_JewelryStyle", members = {
        @Persistent(name = "style")}),
    @FetchGroup(name = "detach_ProductJewelry_ProductGold", members = {
        @Persistent(name = "productGold")}),
    @FetchGroup(name = "detach_ProductJewelry_JewelryCost", members = {
        @Persistent(name = "goldType")}),
    @FetchGroup(name = "detach_ProductJewelry_Goldsmith", members = {
        @Persistent(name = "jewelryCost")})
})
public class ProductJewelry extends Product {

    @Persistent
    private ProductGold productGold;
    @Persistent
    @Column(defaultValue = "0")
    private double totalWeight;
    @Persistent
    @Column(defaultValue = "0")
    private double gemWeight;
    @Persistent
    private JewelryCost jewelryCost;
    @Persistent
    @Column(defaultValue = "0")
    private double wageCost; //tien cong von
    @Persistent
    @Column(defaultValue = "0")
    private double wagePrice;//gia cong
    @Persistent
    private Goldsmith goldsmith;
    @Persistent
    @Column(defaultValue = "0")
    private double gemPrice;

    public ProductGold getProductGold() {
        return productGold;
    }

    public void setProductGold(ProductGold productGold) {
        this.productGold = productGold;
    }

    public JewelryCost getJewelryCost() {
        return jewelryCost;
    }

    public void setJewelryCost(JewelryCost jewelryCost) {
        this.jewelryCost = jewelryCost;
    }

    public double getWageCost() {
        return wageCost;
    }

    public void setWageCost(double wageCost) {
        this.wageCost = wageCost;
    }

    public double getWagePrice() {
        return wagePrice;
    }

    public void setWagePrice(double wagePrice) {
        this.wagePrice = wagePrice;
    }

    public Goldsmith getGoldsmith() {
        return goldsmith;
    }

    public void setGoldsmith(Goldsmith goldsmith) {
        this.goldsmith = goldsmith;
    }

    public double getGemPrice() {
        return gemPrice;
    }

    public void setGemPrice(double gemPrice) {
        this.gemPrice = gemPrice;
    }

    public double getTotalWeight() {
        return totalWeight;
    }

    public void setTotalWeight(double totalWeight) {
        this.totalWeight = totalWeight;
    }

    public double getGemWeight() {
        return gemWeight;
    }

    public void setGemWeight(double gemWeight) {
        this.gemWeight = gemWeight;
    }

    public double getNetWeight() {
        return totalWeight - gemWeight;
    }
}
